
/**
 * 延迟 promise
 * @params {delay} 等待时间, 单位 ms
 */

function delayPromise (delay: number = 0, callBack: Function = () => {}) : Promise<void> {
    return new Promise((resolve) => {
        setTimeout (() => {
            callBack ()
            resolve ()
        }, delay)
    })
}

export default delayPromise